USE [AnotherSuccessfulProcedure]

IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[ClassesHeadshotCountSelect]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
BEGIN
	DROP PROCEDURE dbo.ClassesHeadshotCountSelect
END


SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Neil Wilson
-- Create date: 09/24/08
-- Description:	Classes Table Kill Count Select
-- =============================================
CREATE PROCEDURE ClassesHeadshotCountSelect

	@ClassId int

AS

BEGIN

	SELECT COUNT(Kills.Attacker_classId) AS [Kills] FROM Kills
	WHERE Kills.Attacker_classId = @ClassId
	AND CustomKillId = (SELECT CustomKillId FROM customkills
			WHERE CustomKillShortName = 'headshot')

END
GO
